package com.gulimall.member.controller;

import com.gulimall.common.utils.R;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Package: com.gulimall.member.controller
 * Description：
 * Author: huangjian
 * Date:  2020/6/16 15:15
 * Modified By:
 */
@RefreshScope
@RestController
@RequestMapping("member/member")
public class NacosController {
    @Value("${member.name}")
    private String name;
    @Value("${member.age}")
    private Integer age;
    /**
     * 我的配置
     */
    @RequestMapping("/config")
    public R config(@RequestParam Map<String, Object> params){
        return R.ok().put("name", name).put("age",age);
    }

}
